package cn.stockinclient.Client;

import cn.stockinclient.model.StockIn;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name="stock-in-service",fallback = StockInFallback.class)
public interface StockInClient {

    /**
     * 根据入库单id查询
     */
    @GetMapping("/findByStockInId/{stockInId}")
    StockIn findByStockInId(@RequestParam(value = "stockInId") Long stockInId);

    /**
     * 查询所有入库单
     */
    @GetMapping("/queryAllStockIn")
    List<StockIn> queryAllStockIn();

    /**
     * 根据入库单id删除
     */
    @DeleteMapping("/deleteStockIn/{stockInId}")
    boolean deleteStockIn(@RequestParam(value = "stockInId") Long stockInId);

    /**
     * 新增入库单
     */
    @PostMapping("/addNewStockIn")
    boolean addNewStockIn(@RequestBody StockIn stockIn);

    /**
     * 修改入库单
     */
    @PutMapping("/updateStockIn")
    boolean updateStockIn(@RequestBody StockIn stockIn);
}
